import {Component, Input, OnInit, TemplateRef} from '@angular/core';
import {IPDialog, IPDialogConfig, IPDialogData} from '../../../model/share.model';

@Component({
  selector: 'app-base-dialog',
  templateUrl: './base-dialog.component.html'
})
export class BaseDialogComponent implements OnInit, IPDialog {
  _dialog: IPDialog;

  @Input() set dialog(value){
    this._dialog = value;
  }
  get config(){
    return this._dialog.config;
  }
  get data(){
    return this._dialog.data;
  }
  get content(){
    return this._dialog.content;
  }
  get model(){
    return this._dialog.data.inData;
  }
  constructor() {
    console.log(111);
  }
  ngOnInit() {

  }
  yes() {
    console.log(this.model);
    this.config.yes(this.model);
    this.config.display = false;
  }
  no() {
    this.config.display = false;

  }
}
